<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>首页</title>
    <link rel="stylesheet" type="text/css" href="/static/lib/jquery-easyui-1.7.0/themes/bootstrap/easyui.css">
    <link rel="stylesheet" type="text/css" href="/static/lib/jquery-easyui-1.7.0/themes/icon.css">
    <script type="text/javascript" src="/static/lib/jquery-easyui-1.7.0/jquery.min.js"></script>
    <script type="text/javascript" src="/static/lib/jquery-easyui-1.7.0/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="/static/lib/jquery-easyui-1.7.0/locale/easyui-lang-zh_CN.js"></script>

    <script src="/static/lib/vue.js"></script>
    <script src="/static/lib/bokeh-2.0.1.min.js"></script>
    <style type="text/css">

    </style>
</head>
<body class="easyui-layout">
<div data-options="region:'north',border:false" style="height:80px;background:#B3DFDA;">
    <div style="font-size: 22px;    padding: 20px;">软件无线电定义系统</div>
    <span style="position: absolute;
    right: 10px;
    bottom: 10px;
    float: right;">欢迎您! {{ user }}</span>
</div>

<div data-options="region:'west',title:'导航',collapsible:false" style="width:200px;">
    <div id="sm" class="easyui-sidemenu" style="width: 98%;" data-options="data:data,border:false"></div>
</div>

<div data-options="region:'east',title:'East',collapsible:false" style="width:100px;padding:10px;">east region</div>

<div data-options="region:'south',border:false" style="height:50px;background:#A9FACD;padding:10px;">版权所有2020</div>

<div data-options="region:'center',title:'Center'">

{#    <div id="bokeh_id">#}
{#        <a id="testclick" href="#" v-on:click="loadBokeh" class="easyui-linkbutton"#}
{#           data-options="iconCls:'icon-large-clipart',size:'large',iconAlign:'top'">加载</a>#}
{#        <div v-html="html">#}
{#        </div>#}
{#    </div>#}

    <iframe src="https://demo.bokeh.org/surface3d" style="width: 100%;height: 95%;border: 0px;"></iframe>
</div>

<script type="text/javascript">
    let app = new Vue({
        el: '#bokeh_id',
        data: {
            html: ''
        },
        methods: {
            loadBokeh: function () {
                $.ajax({
                    url: "/loadimg/",
                    sync: true,
                    success: function (a) {
                        debugger
                        let result = JSON.parse(a);

                        app._data.html = result.div;

                        // 插入绘制script代码
                        let bokehRunScript = document.createElement('SCRIPT')
                        bokehRunScript.setAttribute('type', 'text/javascript')
                        let t = document.createTextNode(result.js)
                        bokehRunScript.appendChild(t)
                        document.body.appendChild(bokehRunScript)

                        $('.bk-logo-small').css('display', 'none')
                    }
                });
            }
        }
    })
    var data = [{
        text: '菜单A',
        iconCls: 'icon-edit',
        state: 'open',
        children: [{
            text: 'Option1'
        }, {
            text: 'Option2'
        }, {
            text: 'Option3',
            children: [{
                text: 'Option31'
            }, {
                text: 'Option32'
            }]
        }]
    }, {
        text: 'Item2',
        iconCls: 'icon-more',
        children: [{
            text: 'Option4'
        }, {
            text: 'Option5'
        }, {
            text: 'Option6'
        }]
    }];

    function toggle() {
        var opts = $('#sm').sidemenu('options');
        $('#sm').sidemenu(opts.collapsed ? 'expand' : 'collapse');
        opts = $('#sm').sidemenu('options');
        $('#sm').sidemenu('resize', {
            width: opts.collapsed ? 60 : 200
        })
    }
</script>
</body>
</html>